import request from '@/utils/request'

export default {
  pageList(page, limit, searchObj) {
    return request({
      url: `/admin/doctor/list/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  removeById(id) {
    return request({
      url: `/admin/doctor/remove/${id}`,
      method: 'delete'
    })
  },
  batchRemove(idList) {
    return request({
      url: `/admin/doctor/batch-remove`,
      method: 'delete',
      data: idList
    })
  },
  save(doctor) {
    return request({
      url: '/admin/doctor/save',
      method: 'post',
      data: doctor
    })
  },
  getById(id) {
    return request({
      url: `/admin/doctor/get/${id}`,
      method: 'get'
    })
  },
  updateById(doctor) {
    return request({
      url: '/admin/doctor/update',
      method: 'put',
      data: doctor
    })
  },
  selectNameListByKey(key) {
    return request({
      url: `/admin/doctor/list/name/${key}`,
      method: 'get'
    })
  }
}

